package cn.hqm.hqmtechnology.controller;

import cn.hqm.hqmtechnology.annotations.PassToken;
import cn.hqm.hqmtechnology.common.R;
import cn.hqm.hqmtechnology.dao.dto.MemberInfoDTO;
import cn.hqm.hqmtechnology.service.MemberInfoService;
import cn.hutool.http.HttpResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;

@RestController
public class SysMemberController {


    @Resource
    private MemberInfoService memberInfoService;

    @PostMapping("/sysMember/register")
    @PassToken
    public R register(@RequestBody MemberInfoDTO memberInfoDTO) {
        return R.ok(memberInfoService.addMemberInfo(memberInfoDTO));
    }
    @PostMapping("/sysMember/login")
    @PassToken
    public R login(@RequestBody MemberInfoDTO memberInfoDTO) {
        return R.ok(memberInfoService.login(memberInfoDTO));
    }
    @PostMapping("/sysMember/info")
    public R info(@RequestBody MemberInfoDTO memberInfoDTO) {
        return R.ok(memberInfoService.info(memberInfoDTO));
    }
    @PostMapping("/sysMember/logout")
    public R logout(@RequestBody MemberInfoDTO memberInfoDTO) {
        return R.ok(memberInfoService.logout(memberInfoDTO));
    }

}
